package com.xgk.boot.module.core.dal.entity.order;

import com.baomidou.mybatisplus.annotation.*;
import com.xgk.boot.framework.mybatis.core.dataobject.BaseDO;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 订单取消记录表
 * </p>
 *
 * @author yfbao
 * @since 2025-06-14
 */
@Data
@TableName("order_return_limit")
public class OrderReturnLimitDO extends BaseDO {

    @TableId(value = "or_id", type = IdType.ASSIGN_ID)
    private Long orId;

    /**
     * 操作类型
     */
    @TableField(value = "op_type")
    private String opType;

    /**
     * 操作状态：0申请中，1已退回，2异常
     */
    @TableField(value = "op_status")
    private Integer opStatus;

    /**
     * 订单ID
     */
    @TableField(value = "order_id")
    private Long orderId;

    /**
     * 订单编号
     */
    @TableField(value = "order_code")
    private String orderCode;

    /**
     * 客户代码
     */
    @TableField(value = "customer_code")
    private String customerCode;

    /**
     * 客户姓名
     */
    @TableField(value = "customer_name")
    private String customerName;

    /**
     * 订单总金额
     */
    @TableField(value = "ol_value")
    private BigDecimal olValue;

    /**
     * 物流产品代码
     */
    @TableField(value = "sm_code")
    private String smCode;

    /**
     * 服务商代码
     */
    @TableField(value = "as_code")
    private String asCode;

    /**
     * 取消类型：0系统取消，1API取消
     */
    @TableField(value = "ol_type")
    private Integer olType;

    /**
     * 变化前状态
     */
    @TableField(value = "order_status_from")
    private Integer orderStatusFrom;

    /**
     * 变化后状态
     */
    @TableField(value = "order_status_to")
    private Integer orderStatusTo;

    /**
     * 开始时间
     */
    @TableField(value = "ol_add_time", fill = FieldFill.INSERT)
    private Date olAddTime;

    /**
     * 结束时间
     */
    @TableField(value = "ol_end_time")
    private Date olEndTime;

    /**
     * 更新时间
     */
    @TableField(value = "ol_update_time")
    private Date olUpdateTime;

    /**
     * 操作用户ID
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 操作IP
     */
    @TableField(value = "ol_ip")
    private String olIp;

    /**
     * 备注信息
     */
    @TableField(value = "ol_comments")
    private String olComments;

    /**
     * 账单状态：1未出账，2已出账
     */
    @TableField(value = "bil_status")
    private Integer bilStatus;

    @Override
    public String toString() {
        return "OrderReturnLimit{" +
        ", orId = " + orId +
        ", opType = " + opType +
        ", opStatus = " + opStatus +
        ", orderId = " + orderId +
        ", orderCode = " + orderCode +
        ", customerCode = " + customerCode +
        ", customerName = " + customerName +
        ", olValue = " + olValue +
        ", smCode = " + smCode +
        ", asCode = " + asCode +
        ", olType = " + olType +
        ", orderStatusFrom = " + orderStatusFrom +
        ", orderStatusTo = " + orderStatusTo +
        ", olAddTime = " + olAddTime +
        ", olEndTime = " + olEndTime +
        ", olUpdateTime = " + olUpdateTime +
        ", userId = " + userId +
        ", olIp = " + olIp +
        ", olComments = " + olComments +
        ", bilStatus = " + bilStatus +
        "}";
    }
}
